document.write('<style type=\"text\/css\">#ad_headerbanner{width: 360px;}<\/style>');
{
if ((location.href.indexOf("&baike=") >= 10) && (document.getElementById("nav") != null)){document.getElementById("nav").innerHTML = ("<a href='bbs.php'>"+$("header").getElementsByTagName('h2')[0].getElementsByTagName("a")[0].title+"&#x641C;&#x7D22;</a> &raquo; &#x641C;&#x7D22;&#x7ED3;&#x679C;");}
    if ((location.href.indexOf("&baike=") >= 10) && (document.getElementById("wrap") != null)){document.getElementById("wrap").innerHTML =($("header").getElementsByTagName('h2')[0].getElementsByTagName("a")[0].title+"&#x641C;&#x7D22;&#x6B63;&#x5728;&#x67E5;&#x8BE2;&#x641C;&#x7D22;&#x7ED3;&#x679C;&#x2026;&#x2026;<img src=http://img.tongji.linezing.com/1110974/tongji.gif>");}
$("ad_headerbanner").innerHTML = ($("header").getElementsByTagName('h2')[0].getElementsByTagName("a")[0].title+"&#x667A;&#x80FD;&#x641C;&#x7D22;&#x6846;&#x8F7D;&#x5165;&#x4E2D;&#x2026;&#x2026;"); 
  var GetRandomn = 1;
    function GetRandom(n) {
        GetRandomn = Math.floor(Math.random() * n + 1)
    }
    GetRandom("10000");
    result = new Array();
    result[00] = window.location.protocol +'//'+ window.location.host +'/pm.php?action=new&uid=' + GetRandomn
    result[01] = window.location.protocol +'//'+ window.location.host +'/viewthread.php?tid=' + GetRandomn
    result[02] = window.location.protocol +'//'+ window.location.host +'/forumdisplay.php?fid=' + GetRandomn
    result[03] = window.location.protocol +'//'+ window.location.host +'/bbs.php?gid=' + GetRandomn
    result[04] = window.location.protocol +'//'+ window.location.host +'/space.php?action=viewpro&uid=' + GetRandomn
    result[05] = window.location.protocol +'//'+ window.location.host +'/stats.php?type=modworks&uid=' + GetRandomn
    baike = Math.floor(Math.random() * result.length);
    google.load('search', '1', {
        language: 'zh-CN',
        style: google.loader.themes.BUBBLEGUM
    });
    google.setOnLoadCallback(function() {
        var customSearchControl = new google.search.CustomSearchControl(gsearchid);
        customSearchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
        var options = new google.search.DrawOptions();
        options.setAutoComplete(true);
        options.enableSearchboxOnly(result[baike], "baike");
        customSearchControl.draw('ad_headerbanner', options);
    },
    true);
    function parseQueryFromUrl() {
        var queryParamName = "baike";
        var search = window.location.search.substr(1);
        var parts = search.split('&');
        for (var i = 0; i < parts.length; i++) {
            var keyvaluepair = parts[i].split('=');
            if (decodeURIComponent(keyvaluepair[0]) == queryParamName) {
                return decodeURIComponent(keyvaluepair[1].replace(/\+/g, ' '));
            }
        }
        return '';
    }
    if (location.href.indexOf("baike=") >= 10) {
        google.load('search', '1', {
            language: 'zh-CN',
            style: google.loader.themes.BUBBLEGUM
        });
        google.setOnLoadCallback(function() {
            var customSearchControl = new google.search.CustomSearchControl(gsearchid);
            customSearchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
            var options = new google.search.DrawOptions();
            options.setAutoComplete(true);
            options.enableSearchResultsOnly();
            customSearchControl.draw('wrap', options);
            var queryFromUrl = parseQueryFromUrl();
            if (queryFromUrl) {
                customSearchControl.execute(queryFromUrl);
            }
        },
        true);
    }
}